<template>
    <div>
        <el-input
  type="textarea"
  autosize
  placeholder="标题"
  v-model="title" >
</el-input>
<div style="margin: 20px 0;"></div>
<el-input
  type="textarea"
  :autosize="{ minRows: 2, maxRows: 4}"
  placeholder="请输入内容"
  v-model="textarea2" v-show="true">
</el-input>
<el-input
  type="textarea"
  :autosize="{ minRows: 2, maxRows: 4}"
  placeholder="请输入内容"
  v-model="textarea3" v-show="a">
</el-input>
<el-input
  type="textarea"
  :autosize="{ minRows: 2, maxRows: 4}"
  placeholder="请输入内容"
  v-model="textarea4" v-show="a">
</el-input>
<div id="margin"> <el-button type="warning" round @click="clear">清空所有</el-button>  <el-button type="success" round @click="show" >展开全部</el-button>   </div>
 
    </div>
</template>

<style>
#margin{
    margin: 20px;
}
</style>


<script>
export default {
  data() {
    return {
      a:false,
      title: '                                                                                                                                                                        备忘录',
      textarea2: '明天向领导建议更换一批消防栓',
      textarea3:'明天检查逸夫楼',
      textarea4:'后天下午在综合楼517开会',
      
   }
   
  },
 created(){
   this.add();
 },
  methods:{
         add(){
        let url =`http://localhost:3000/memorandum` ;
        this.axios.post(url,{
          content:this.memorandum.content
        }).then((response)=>{
          this.textarea2=response.data.content;
       });
      },

        show(){
            this.a=!this.a
        },

        clear(){
            this.textarea2="";
            this.textarea3="";
            this.textarea4="";
        }
       
  }
}
</script>